package com.bwie.coupon.controller;

import com.bwie.common.core.domain.Result;
import com.bwie.coupon.domain.po.MlCoupon;
import com.bwie.coupon.domain.po.MlSeller;
import com.bwie.coupon.service.MlSellerService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RequestMapping("/mlSeller")
@RestController
@Log4j2
public class MlSellerController {
    @Autowired
    private MlSellerService mlSellerService;
    @Autowired
    private HttpServletRequest request;



    /**
     * 购物车优惠卷
     * @return
     */
    @GetMapping("/mlCouponList/{sellerId}")
    public Result mlCouponList(@PathVariable Long sellerId){
        log.info("方法名称：商家下的所有优惠卷,请求URL:{},请求放方式:{},请求参数:{}",
                request.getRequestURI(),request.getMethod(),sellerId);
        Result result = mlSellerService.selectMlSeller(sellerId);
        log.info("方法名称：用户领取优惠卷,请求URL:{},请求放方式:{},响应结果:{}",
                request.getRequestURI(),request.getMethod(),result);
     return  result;
    }



}
